package cn.demo.act.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.core.constant.SqlOperator;
import com.mybatisflex.core.query.SqlOperators;
import cn.demo.common.mybatisFlex.MyInsertListener;
import cn.demo.common.mybatisFlex.MyUpdateListener;
import cn.demo.common.annotation.Excel;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fasterxml.jackson.annotation.JsonIgnore;
import cn.demo.common.core.domain.BaseEntity;
/**
 * 活动材料管理对象 act_material
 *
 * @author xtjun
 * @date 2024-06-03
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Table(value = "act_material",onInsert = MyInsertListener.class,onUpdate = MyUpdateListener.class)
public class ActMaterial extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @Id
    @Schema(description = "id")
    private String id;

    @Excel(name = "活动id")
    @Schema(description = "活动id")
    private String activityId;

    @Excel(name = "材料名称")
    @Schema(description = "材料名称")
    private String materialName;

    @Excel(name = "材料地址")
    @Schema(description = "材料地址")
    private String materialUrl;

    @Excel(name = "状态", dictType = "sys_data_status")
    @Schema(description = "状态(字典:sys_data_status)")
    private Integer status;

    // 自定义字段的 SQL 操作符
    @JsonIgnore
    public static final SqlOperators operators = new SqlOperators() {{
        set(ActMaterial::getActivityId, SqlOperator.EQUALS);
        set(ActMaterial::getMaterialName, SqlOperator.LIKE);
        set(ActMaterial::getStatus, SqlOperator.EQUALS);
    }};
}
